package com.zy.web.demo.duoxiancheng.demo31;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/9/3 9:48
 */
public class Test31 {

    public static void main(String[] args) {
        final Service31 service31 = new Service31();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                service31.await();
            }
        };
        Thread A = new Thread(runnable);
        A.start();
        Thread B = new Thread(runnable);
        B.start();
        System.out.println(service31.lock.hasQueuedThread(A));
        System.out.println(service31.lock.hasQueuedThread(B));
        System.out.println(service31.lock.hasQueuedThreads());
    }

}
